﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="addprescription.aspx.cs" Inherits="MxWeiXinPF.Web.shop.addprescription" %>

<%@ Import Namespace="MxWeiXinPF.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>上传处方</title>
    <meta charset="UTF-8">
    <meta name="viewport" content=" initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <script type="text/javascript" src="../scripts/jquery/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" src="../scripts/datepicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../scripts/swfupload/swfupload.js"></script>
    <script type="text/javascript" src="../scripts/swfupload/swfupload.queue.js"></script>
    <script type="text/javascript" src="../scripts/swfupload/swfupload.handlers.js"></script>
        <script type="text/javascript" src="../admin/js/layout.js"></script>
    <link href="../admin/skin/default/style.css" rel="stylesheet" type="text/css" />
            <link href="/shop/templates/default/css/style.css" rel="stylesheet" />
    <link href="/shop/templates/default/css/templates.css" rel="stylesheet" />

    <script type="text/javascript">
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();
            $("#btnUpload").click(function () {
                //开始准备上传
                $("#imgWait").show();
                var formData = new FormData();
                formData.append("Filedata", document.getElementById("myfile").files[0]);
                if ($("#<%=txturl.ClientID%>").val() != null)
                    formData.append("DelFilePath", $("#<%=txturl.ClientID%>").val());
                $.ajax({
                    url: "../tools/upload_ajax.ashx",
                    type: "POST",
                    data: formData,
                    /**
                    *必须false才会自动加上正确的Content-Type
                    */
                    contentType: false,
                    /**
                    * 必须false才会避开jQuery对 formdata 的默认处理
                    * XMLHttpRequest会对 formdata 进行正确的处理
                    */
                    processData: false,
                    success: function (data) {
                        var jsonstr = eval('(' + data + ')');
                        if (jsonstr.status == '1') {
                            $("#<%=txturl.ClientID%>").val(jsonstr.path);
                            alert(jsonstr.msg);
                        }
                        else {
                            alert(jsonstr.msg);
                        }
                        $("#imgWait").hide();
                    }
                });

            });
        });
    </script>
</head>
<body class="mainbody">
    <form id="form1" runat="server">
    <input id="hwid" type="hidden" runat="server" />
    <input id="hid" type="hidden" runat="server" />
<!--
       <div class="lay_header" style="height: 45px">
        <div class="lay_toptab mod_tab" id="lay_head">
            <a class="tab_item" href="<%=indexurl %>"><i class="qb_icon icon_goback"></i></a>
            <a class="tab_item tab_item_logo" href="{$indexurl}">
            <img src="{$shopconfig.logo}" />
        </a>
            <a class="tab_item" href="<%=userinfourl %>"><i class="qb_icon icon_icenter"></i>
            </a><a class="tab_item" href="<%=carturl %>"><i class="qb_icon icon_cart"></i></a>
        </div>
        <div class="lay_toptab mod_tab fixed qb_none" id="lay_head_fixed">
            <a class="tab_item" href="<%=indexurl %>"><i class="qb_icon icon_goback"></i></a>
            <!--<a class="tab_item tab_item_logo" href="{$indexurl}">
           <img src="{$shopconfig.logo}" style="width: 132px; margin-top: 8px;" />
        </a>
            <a class="tab_item" href="<%=userinfourl %>"><i class="qb_icon icon_icenter"></i>
            </a><a class="tab_item" href="<%=carturl %>"><i class="qb_icon icon_cart"></i></a>
        </div>
    </div>-->
    <!--导航栏-->
    <div class="location">
        <span>上传处方</span>
    </div>
    <!--/导航栏-->
    <!--内容-->
    <div class="tab-content">  

        <dl>
            <dt style=" width:65px; text-align:center">处方单图片</dt>
            <dd style="margin-left:75px"> 
               <input type="file" id="myfile" style="font-size:16px" />
               <input type="button" id="btnUpload" style="font-size:20px" value="上传" />
               <img src="Images/wait.gif" style="display:none" id="imgWait" />
            </dd>
        </dl>
         <dl style="display:none">
            <dt style="width:65px; text-align:center;display:none">图片地址</dt>
            <dd style="margin-left:75px"> 
                <input id="txturl" type="text" class="input txt" runat="server" />
            </dd>
        </dl>
         <dl>
            <dt style=" width:65px; text-align:center">病状说明</dt>
            <dd style="margin-left:75px">
                <asp:TextBox ID="txtRemarks" runat="server" CssClass="input txt" datatype="*0-255"
                    errormsg="" sucmsg=" "></asp:TextBox></dd>
        </dl>        
    </div>
    <!--内容-->
    <!--工具栏-->
    <div>
        <div class="btn-list" style=" text-align:center">
            <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
            <asp:Button ID="btnHome" runat="server" Text="返回" CssClass="btn yellow" 
                onclick="btnHome_Click" />
        </div>
        <div class="clear">
        </div>
    </div>
    <!--/工具栏-->
    <div class="lay_footer qb_tac qb_fs_s mod_mb15">
        <div id="footer">
            <div class="positionFooter">
                <ul>
                    <li><a class="a1" href="<%=indexurl %>">首页</a></li>
                    <li><a class="a2" href="<%=categoryurl %>">药品分类</a></li>
                    <li><a class="a3" href="<%=carturl %>">购物车</a></li>
                    <li><a class="a4" href="<%=userinfourl %>">会员中心</a></li>
                </ul>
            </div>
        </div>
<%--        <div class="fn_copyright qb_bfc">
            <div class="mod_color_comment bfc_c">&copy;&nbsp; 易药宝</div>
        </div>--%>
    </div>
    </form>
</body>
</html>
